#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<string.h>

int reverse(char arr1[6], char arr2[6]) {
	int count = 0;
	int num = 0;
	for (int j = 0; j < 5; j++) {
		if (arr1[j] == arr2[j])
			num++;
		if (num == 5)
			return count;
	}
	for (int i = 0; i < 5; i++) {
		count++;
		char tmp = arr1[i];
		arr1[1] = arr1[5 - i];
		arr1[5 - i] = tmp;
		for (int j = 0; j < 5; j++) {
			if (arr1[j] == arr2[j])
				num++;
			if (num == 5)
				return count;
		}
	}
}

int main() {
	char arr1[6] = "ABCDE";
	char arr2[6] = "EBCDA";
	int ret = reverse(arr1, arr2);
	printf("%d", ret);
	return 0;
}